<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/23
  Time: 10:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>人力资源管理后台界面</title>
    <link href="../css/homePage.css" rel="stylesheet" type="text/css"/>
    <link href="../css/resume.css" type="text/css">
    <script type="text/javascript" src="../script/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="../script/commonFunction.js"></script>
    <script type="text/javascript" src="../script/backStage.js"></script>
    <style type="text/css">
        #main_body {
            background-image: url("../images/bg90.jpg");
        }

        #admin_menu_div {
            overflow: hidden;
            margin-top: -20px;
            border-bottom: double 2px #bbc;
        }

        #admin_menu_div_ul {
            overflow: hidden;
        }

        #admin_menu_div_ul h4 {
            position: relative;
            float: left;
            margin-right: 5%;
            border-color: #ffd8d7;
        }

        #admin_menu_div_ul h4:first-child {
            margin-left: 8%;
        }

        #admin_menu_div_ul h4:last-child {
            margin-right: 0;
        }

        table {
            background-color: rgba(0, 130, 230, 0.6);
        }

    </style>
    <script type="text/javascript">
        $(function () {
            $("#admin_main_div").children().hide();

            tick();

            <c:if test="${not empty applyNotLook}">
            if (confirm("您有新的应聘消息，是否要现在查看？")) ;
            </c:if>

            $("#admin_apply_manage").click(function () {
                window.location.href = "../apply/goApplyManage";
            });

            $("#admin_section_manage").click(function () {
                switchoverColor(this, $("#sectionList"));
            });

            $("#admin_train_manage").click(function () {
                window.location.href = "../admin/goTrainManage";
            });

            $("#admin_employee_manage").click(function () {
                window.location.href = "../admin/goEmployeeManage";
            });

            $("#admin_reward_manage").click(function () {
                switchoverColor(this, $("#admin_reward"));
                selectYMD($("#reward_year"), $("#reward_month"));
                $("#admin_reward_table").find("tbody").html("").append("<tr><td colspan='6'>支持按月份查询</td></tr>");
            });

            $("#admin_salary_manage").click(function () {
                switchoverColor(this, $("#admin_salary"));
//                selectYMD($("#salary_year"), $("#salary_month"));
//                $("#admin_salary_table").find("tbody").html("").append("<tr><td colspan='8'>支持按月份、部门、职位、员工查询</td></tr>");
//                $("#salary_position").hide();
//                $("#salary_resume").hide();
                judgeOperation();
            });

            $("#admin_salary_dissent").click(function () {
                switchoverColor(this, $("#admin_dissent"));
                $("#admin_dissent_table").find("tbody").html("").append("<tr><td colspan='8'>暂无相关信息！</td></tr>");
                getDissentList();
//                $("#admin_deal_background").show();
//                $("#admin_deal_dissent").show();
            });
        });


    </script>
</head>
<body id="main_body">
<div id="welcome">
    <c:if test="${manager != null}">
        欢迎${manager.name }登录&nbsp;&nbsp;&nbsp;<a id="admin_quit0" onclick="quit(this)">退出</a>
    </c:if>
    <c:if test="${manager == null }">
        <%response.sendRedirect("../admin/login.jsp");%>
    </c:if>
    <span id="showTime">本地时间：<span id="localtime"></span></span>
</div>
<div id="admin_menu_div">
    <ul id="admin_menu_div_ul">
        <h4>
            <li id="admin_apply_manage">应聘管理</li>
        </h4>
        <h4>
            <li id="admin_section_manage">部门职位</li>
        </h4>
        <h4>
            <li id="admin_train_manage">培训管理</li>
        </h4>
        <h4>
            <li id="admin_employee_manage">员工管理</li>
        </h4>
        <h4>
            <li id="admin_reward_manage">奖惩管理</li>
        </h4>
        <h4>
            <li id="admin_salary_manage">薪资管理</li>
        </h4>
        <h4>
            <li id="admin_salary_dissent">工资异议</li>
        </h4>
        <h4>
            <li id="quit" onclick="quit(this)">退出</li>
        </h4>
    </ul>
</div>
<div id="admin_main_div">

    <div id="sectionList" style="margin-left: 36%;">
        <jsp:include page="sectionList.jsp"/>
    </div>

    <div id="admin_reward">
        <div id="admin_reward_div0" style="width: 699px; margin: 10px auto">
            <select id="reward_year"></select>
            <select id="reward_month"></select>
            <select id="employee_sections" onchange="choosePosition1()">
                <option value="">部门</option>
                <c:forEach items="${sections}" var="se">
                    <option value="${se.id}">${se.section}</option>
                </c:forEach>
            </select>
            <select id="employee_positions">
                <option value="">职位</option>
            </select>
            <input type="button" value="查询" onclick="findRPList()">
            <table cellpadding="0" cellspacing="0" border="1px" id="admin_reward_table">
                <thead>
                <tr>
                    <th colspan="6">奖惩信息</th>
                </tr>
                <tr>
                    <th style="padding: 1px 10px">编号</th>
                    <th style="padding: 1px 10px">人员</th>
                    <th style="padding: 1px 10px">奖惩原因</th>
                    <th style="padding: 1px 10px">奖惩时间</th>
                    <th style="padding: 1px 10px">奖惩金额</th>
                    <th style="padding: 1px 10px">奖惩类型</th>
                </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </div>

    <div id="admin_salary">
        <div id="admin_salary_div0" style="width: 699px; margin: 10px auto">
            <select id="salary_operation" onchange="judgeOperation()">
                <option value="0">工资查询</option>
                <option value="1">工资发放</option>
            </select>
            <select id="salary_year"></select>
            <select id="salary_month"></select>
            <select id="salary_section" onchange="sectionChanged(this)">
                <c:forEach items="${sections}" var="section">
                    <option value="${section.id}">${section.section}</option>
                </c:forEach>
            </select>
            <select id="salary_position" onchange="positionChanged(this)">
                <option value="">职位</option>
            </select>
            <select id="salary_resume">
                <option value="">员工</option>
            </select>
            <input type="button" value="查询" onclick="findSalaryList()">
            <form action="../salary/addSalaryList" method="post" onsubmit="return checkPerformance(this)">
                <table cellpadding="0" cellspacing="0" border="1px" id="admin_salary_table">
                    <thead>
                    <tr>
                        <th colspan="9">薪资信息</th>
                    </tr>
                    <tr>
                        <th style="padding: 1px 10px">编号</th>
                        <th style="padding: 1px 10px">员工</th>
                        <th style="padding: 1px 10px">最终实发</th>
                        <th style="padding: 1px 10px">基本工资</th>
                        <th style="padding: 1px 10px">绩效工资</th>
                        <th style="padding: 1px 10px">加班工资</th>
                        <th style="padding: 1px 10px">奖惩工资</th>
                        <th style="padding: 1px 10px">社保</th>
                        <th style="padding: 1px 10px">发放月份</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                    <tfoot>
                    <tr>
                        <td colspan="9" style="text-align: center">
                            <input type="submit" value="确认发放">
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </form>
        </div>
    </div>

    <div id="admin_dissent">
        <div id="admin_dissent_div0" style="width: 699px; margin: 10px auto">
            <select id="admin_dissent_select" onchange="getDissentList()">
                <option value="0">未查看</option>
                <option value="1">已查看</option>
            </select>
            <table cellpadding="0" cellspacing="0" border="1px" id="admin_dissent_table">
                <thead>
                <tr>
                    <th colspan="5">薪资异议信息</th>
                </tr>
                <tr>
                    <th style="padding: 1px 10px">编号</th>
                    <th style="padding: 1px 10px">员工</th>
                    <th style="padding: 1px 10px">理由</th>
                    <th style="padding: 1px 10px">月份</th>
                    <th style="padding: 1px 10px">操作</th>
                </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
    </div>

    <div id="admin_deal_background" class="background"></div>
    <div id="admin_deal_dissent" style="position: absolute;z-index: 1000;width: 100%;height: 100%">
        <fieldset id="fieldset_deal">
            <legend align="center">异议处理</legend>
            <form action="../dissent/updateDissent" method="post" onsubmit="return checkDissentDealForm()"
                  id="dissent_form">
                <div>
                    处理意见：<input type="text" name="deal" id="deal" placeholder="请输入处理意见" style="margin-top: 15px"/>
                </div>
                <div class="error" id="name_error"></div>

                <input type="hidden" name="looked" value="1">
                <input type="hidden" name="id" class="dissentId">

                <div style="margin-top: 20px">
                    <input type="submit" value="提交处理" id="submit1" class="sub" style="margin-left: 50px"/>
                    <input type="reset" value="取消" class="sub" id="dissent_deal_reset" onclick="dissentDealReset()"/>
                </div>
            </form>
        </fieldset>
    </div>

</div>

</body>
</html>
